package cn.buk.tms.dto;

import cn.buk.tms.entity.misc.CustomerPosition;
import org.springframework.beans.BeanUtils;

/**
 * 企业客户的职位
 * 职位级别、职位名称
 */
public class CustomerPositionDto {

    private int id;

    /**
     * 级别ID，用数字表示，数字越大，等级越高
     */
    private int positionId;

    /**
     * 职位代码
     */
    private String positionCode;

    /**
     * 级别名称
     */
    private String name;

    /**
     * vip level
     * 0: 不是vip
     * 1-10: vip等级，10最高
     */
    private int vipLevel;

    /**
     * 0-新增
     * 4-删除
     */
    private int mode;

    public static CustomerPositionDto createdBy(CustomerPosition o) {
        if (o == null) {
            return null;
        }

        CustomerPositionDto dto = new CustomerPositionDto();
        BeanUtils.copyProperties(o, dto);

        return dto;
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getVipLevel() {
        return vipLevel;
    }

    public void setVipLevel(int vipLevel) {
        this.vipLevel = vipLevel;
    }

    public int getPositionId() {
        return positionId;
    }

    public void setPositionId(int positionId) {
        this.positionId = positionId;
    }

    public String getPositionCode() {
        return positionCode;
    }

    public void setPositionCode(String positionCode) {
        if (positionCode != null) {
            positionCode = positionCode.trim().toUpperCase();
        }
        this.positionCode = positionCode;
    }

    public int getMode() {
        return mode;
    }

    public void setMode(int mode) {
        this.mode = mode;
    }
}
